import request2 from '@/utils/request2'
const baseURL='http://localhost:8080/ssm/';
// export default {   ？区别在哪？ 前端需要获取那个，然后.出来。
//   getListByCondition3(param){
//     return request2.get(baseURL2+'/devices/findAll/'+param.page+'/'+param.pageSize)
//   },
//   handleAdd(param){
//     return request2.post('http://localhost:8183/devices/save',param)
//   }
// }
export function getListByCondition3(param) {
  return request2({
    method: 'post',
    url: 'http://localhost:8080/ssm/basic/query',
    data:param
    /* url:'http://localhost:8183/devices/findAll/1/10'表示希望传过来的数据是1页有10条数据。
        除此之外，还有findAll/1/5  findAll/1/20  findAll/1/30  findAll/1/50
     */
  })
}

export function queryId(param) {
  return request2({
    // url: '/vue-admin-template/user/login',
    method: 'get',
    url: baseURL+'basic/queryid',
    data:{
      id:param
    },//对应处是body
  })
}
export function addDevice(param) {
  return request2({
    method: 'post',
    url: baseURL+'/basic/insert',
    data:param,//对应处是body
  })
}

export function deleteDevice(param){
  return request2({
    method: 'delete',//相当于this.$axios.delete("http://localhost:8080/ssm/basic/delete?id="+row.id)
    url: baseURL+'/basic/delete',
    params:{/*自动拼接山区*/
      id:param
    }
  })
}

export function update(param){
  return request2({
    method: 'put',//相当于this.$axios.delete("http://localhost:8080/ssm/basic/delete?id="+row.id)
    url: baseURL+'basic/update',
    data:param
  })
}

